#include "student.h"
#include <QDebug>
Student::Student(QObject *parent) : QObject(parent)
{

}

void Student::treat()
{
    qDebug()<<"请老师吃饭";
}

void Student::treat(QString foodName)
{
    //将QString类型的字符串转为char*，先将其转化成QByteArray[toUtf8()],再转化为char*[data()]
    qDebug()<<"请老师吃饭,吃"<<foodName.toUtf8().data();
    //qDebug()<<"请老师吃饭,吃"<<foodName;
}
